var price = new Vue({
	el: '#price',
	data: {
		page_size: 20,
		page_num: 1,
		page_num2: 1,
		total: 0,
		total2: 0,
		shucaiList: [],
		caoyaoList: [],
		type: 0
	},
	watch: {

	},
	mounted: function() {
		this.getShuCaiPrice()
		this.getCaoYaoPrice()
	},
	filters: {
		timeformat: function(value) {
		
			return value.slice(0,9)
		}
		
	},
	methods: {

		getShuCaiPrice: function() {

			var _this = this
			var timestamp = new Date().getTime();
			var pageparam = _this.page_size + '' + _this.page_num;

			axios({
				url: datashang + '/farm/priceYnList?sid=pro_data_acq&timestamp=' + timestamp + '&token=' + encrty(pageparam, datashangkey, timestamp) + '&page_size=' + _this.page_size + '&page_num=' + _this.page_num,
				method: 'POST',
				params: {},
				timeout: 50000,
				// 设置请求头
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				}
			}).then(function(res) {
			
				if(res.data.success == 1) {
					var list = res.data.data.data
					var temp = _this.shucaiList
					_this.shucaiList = []
					_this.shucaiList = temp.concat(res.data.data.data)
					_this.total = list.length
					_this.page_num = _this.page_num + 1
					$('.bottom-line').css('display', 'none');
				}
			})
		},
		getCaoYaoPrice: function() {

			var _this = this
			var timestamp = new Date().getTime();
			var pageparam = _this.page_size + '' + _this.page_num2;

			axios({
				url: datashang + '/plant/priceList?sid=pro_data_acq&timestamp=' + timestamp + '&token=' + encrty(pageparam, datashangkey, timestamp) + '&page_size=' + _this.page_size + '&page_num=' + _this.page_num,
				method: 'POST',
				params: {},
				timeout: 50000,
				// 设置请求头
				headers: {
					'Content-Type': 'application/x-www-form-urlencoded'
				}
			}).then(function(res) {

				if(res.data.success == 1) {

					var list = res.data.data.data
					var temp = _this.caoyaoList
					_this.caoyaoList = []
					_this.caoyaoList = temp.concat(res.data.data.data)
					_this.total2 = list.length
					_this.page_num2 = _this.page_num2 + 1
					$('.bottom-line2').css('display', 'none');
				}
			})
		}
	},
});